package com.lantosec.hmrp.modules.internal.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableId;
import com.lantosec.hmrp.core.mvc.BaseEntity;
import com.lantosec.hmrp.modules.internal.vo.InternalTaskVO;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 * <p>
 * 评价任务 实体类
 * </p>
 *
 * @author AutoCode
 * @since 2020-04-23
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
public class InternalTask extends BaseEntity<InternalTaskVO> {

    private static final long serialVersionUID = 1L;
    public InternalTask(InternalTaskVO vo){
        this.internalTaskId = vo.getInternalTaskId();
        this.internalPlanId = vo.getInternalPlanId();
        this.internalPlanType = vo.getInternalPlanType();
        this.taskTitle = vo.getTaskTitle();
        this.startDate = vo.getStartDate();
        this.endDate = vo.getEndDate();
        this.state = vo.getState();
        this.delay = vo.getDelay();
        this.executorUserNum = vo.getExecutorUserNum();
        this.performUserNum = vo.getPerformUserNum();
    }

    @Override
    public InternalTaskVO convertToVO(){
        return new InternalTaskVO(this);
    }


    /**
     * 评价任务ID
     */
    @TableId(value = "internal_task_id", type = IdType.AUTO)
    private Integer internalTaskId;

    /**
     * 评价方案ID
     */
    private Integer internalPlanId;

    /**
     * 方案类型
     */
    private Integer internalPlanType;

    /**
     * 任务标题
     */
    private String taskTitle;

    /**
     * 任务开始日期
     */
    private String startDate;

    /**
     * 任务结束日期
     */
    private String endDate;

    /**
     * 任务状态(1暂停 2启用 3到期 4作废)
     */
    private Integer state;

    /**
     * 允许延期(工作日)
     */
    private Integer delay;

    /**
     * 评价人总数(参评人数)
     */
    private Integer executorUserNum;

    /**
     * 完成评价的人数
     */
    private Integer performUserNum;


    public enum ColName {
        internal_task_id, internal_plan_id, internal_plan_type, task_title, start_date, end_date, state, delay, executor_user_num, perform_user_num, 
    }
}
